The present invention relates to a tone generating method for arithmetically forming a tone waveform by executing a tone generating program on an arithmetic processor, and a tone generating device based on the tone generating method.
Tone generating devices have been known today, typical examples of which comprise a MIDI (Musical Instrument Digital Interface), a performance input section for entering performance information via a keyboard or sequencer, a tone generator section for generating a tone waveform, and a central processing unit (CPU) for controlling the tone generator section in accordance with the entered performance information. The CPU executes various tone generator driver processing, such as channel assignment and parameter conversion, in accordance with the entered performance information, and supplies the assigned channel with the converted parameters along with a tone-generation start (note-on) instruction. The tone generator section forms a tone waveform on the basis of the supplied parameters and is implemented by hardware such as electronic circuitry. Therefore, the conventional tone generating devices just operate as dedicated devices for tone generation, and it was always necessary to employ such a dedicated device when artificial tones were to be generated.
Recently, a tone generating method has been proposed, in which tone generator processing based on computer programs (software tone generator) is employed in place of the traditional hardware tone generator and performance processing and tone generator processing are both executed by the CPU. Similarly to the above-mentioned tone generator driver processing, the performance processing creates tone control information on the basis of received MIDI information or other performance information. The tone generator processing, on the other hand, forms tone waveform sample data on the basis of the control information created by the performance processing. With this tone generating method, tones can be generated, without any dedicated tone generating device, by just providing a CPU, software program and digital-to-analog (D/A) converter.
In order to generate tones, it is necessary to supply waveform sample data to the D/A converter every sampling cycle, i.e., every conversion timing of the D/A converter. According to the above-mentioned conventional tone generating method, the CPU normally executes the performance processing, such as detection of depressed keys. But, the CPU interrupts the performance processing, every sampling cycle, to execute the tone generator processing in order to arithmetically form one waveform sample data for a plurality of tone generating channels and then returns to the performance processing after the sample data formation.
However, in the above-mentioned conventional tone generating method, the CPU needs to transfer, from a memory into a predetermined register, various data used in the preceding calculation for each of the channels before actually executing the waveform forming calculation for the channel every sampling cycle; after completion of the calculation, the CPU needs to save the contents of the register into the memory, for next execution of the calculation. Namely, because tone waveform sample data is arithmetically formed, for each of the channels, sample by sample in the conventional tone generating method, much time would be spent in preparing operations rather than the tone formation itself, which would result in poor calculating efficiency and response and would considerably delay the tone generating processing. As a result, sufficient time can not be allocated to the waveform forming calculation.
Application programs, such as MIDI sequencer software or game software, for supplying such a software tone generator with MIDI event information or other performance information are designed to operate under an ordinary operating system (OS). When the software tone generator is to be driven by MIDI event information created by the MIDI sequencer software, the sequencer software itself can not be activated unless the OS is run; however, in such a case, it is necessary to operate the software simultaneously with the OS in a stable manner. Thus, it is difficult to operate, in real time, the above-mentioned software tone generator under the ordinary OS.
For example, with an OS based on a non-complete (non-preemptive) multitask scheme, unless a specific task being executed returns control to the OS, any other task is not executed. Thus, the software tone generator can sometimes not be executed at predetermined time intervals, and accordingly tone waveform sample data may not be stably output every sampling cycle.
Further, performance information (MIDI event information) is produced by a player's performance operation or by reproduction of an event via a sequencer, and the produced performance information is processed by the above-mentioned performance processing. Namely, each time performance information is produced, the CPU must execute the performance processing in addition to the normal tone generator processing; thus, due to non-periodically produced performance information, the amount of calculation to be performed would temporarily increase to a substantial degree. However, because the tone generator processing is periodically executed with priority over the performance processing irrespective of presence/absence of performance information, the performance processing could be substantially delayed in some cases.
One approach to avoid such time delays of the performance processing may be to give higher priority to the performance processing rather than the tone generator processing. But, this approach would result in unstable operation of the tone generator processing, such as temporary decrease in the number of generated tones or unwanted temporary break in a formed tone waveform. Particularly, such unstable operation of the tone generator processing would become a significant problem in a real-time performance.
In addition, the conventional software tone generator would require various setting operations before being actually used, because the software tone generator can not be driven by just running an application software program using the conventional hardware generator, i.e., without making any particular change to the application.